package apiday01;

public class ValueofDemo {
    public static void main(String[] args) {
        int a = 123;
        String s1 = String.valueOf(a); //将int型变量a转换为String类型并赋值给s1
        System.out.println(s1); //123---字符串类型

        double b = 123.456;
        String s2 = String.valueOf(b);    //将double类型变量s2转换为String类型并赋值给s2
        System.out.println(s2);         //123.456---字符串类型
        String s3 = b + "";
        System.out.println(s3);     //123.456---字符串类型


    }
}
